package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by bilibili on 2017/3/13.
 */
@Entity
public class FeedBack implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * @备注:
     * @字段:id BIGINT(19)
     */
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @GenericGenerator(name="auto-identity",strategy="identity")
    @Column(updatable = false, columnDefinition="BIGINT(20) COMMENT ''")
    private java.lang.Long id;

    @Column(columnDefinition="INT(3) COMMENT ")
    private int feedbackType;

    @Column(columnDefinition="VARCHAR(300) COMMENT '标题'")
    private String feedbackDetail;

    @Column(columnDefinition="VARCHAR(100) COMMENT '相关图片路径'")
    private String imgUrl;

    @ManyToOne
    @JoinColumn(name="user", columnDefinition="BIGINT(33) COMMENT '商家id'")
    private User user;


    /**
     * @备注:
     * @字段:gmt_datetime DATETIME(19)
     */
    @Column(updatable = false, columnDefinition="DATETIME(19) COMMENT ''")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private java.util.Date gmtDatetime = new java.util.Date();

    /**
     * @备注:
     * @字段:upt_datetime DATETIME(19)
     */
    @Column(columnDefinition="DATETIME(19) COMMENT ''")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private java.util.Date uptDatetime = new java.util.Date() ;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getFeedbackType() {
        return feedbackType;
    }

    public void setFeedbackType(int feedbackType) {
        this.feedbackType = feedbackType;
    }

    public String getFeedbackDetail() {
        return feedbackDetail;
    }

    public void setFeedbackDetail(String feedbackDetail) {
        this.feedbackDetail = feedbackDetail;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Date getGmtDatetime() {
        return gmtDatetime;
    }

    public void setGmtDatetime(Date gmtDatetime) {
        this.gmtDatetime = gmtDatetime;
    }

    public Date getUptDatetime() {
        return uptDatetime;
    }

    public void setUptDatetime(Date uptDatetime) {
        this.uptDatetime = uptDatetime;
    }
}
